import request from '@/utils/request.js'

//获取列表
export function fetchTaskList(params) {
  return request({
    url: 'data',
    method: 'GET',
    params
  })
}

//新增
export function fetchAddTask(data) {
  return request({
    url: 'data',
    method: 'POST',
    data
  })
}

//修改
export function fetchEditTask(data) {
  return request({
    url: `data/${data.id}`,
    method: 'PUT',
    data
  })
}

//详情
export function fetchTaskDetail(data) {
  return request({
    url: `data/${data.id}`,
    method: 'GET',
    data
  })
}

//删除
export function fetchDelTask(data) {
  return request({
    url: `data/${data.id}`,
    method: 'DELETE'
  })
}

//搜索
export function fetchSearchTask(params) {
  return request({
    url: `data/?name=${params}`,
    method: 'GET'
  })
}
